Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Yarn Berry compatibility flag #1012

Merged
merged 4 commits into from
Dec 10, 2021
Merged

Added Yarn Berry compatibility flag #1012

merged 4 commits into from
Dec 10, 2021

Conversation

neo1203
Copy link

@neo1203 neo1203 commented Nov 20, 2021

Summary

Fixes #928.
Added a compatibility flag for Yarn 2.x and above (Berry) so maven-frontend-plugin doesn't consider reported version as invalid anymore and doesn't try to re-install Yarn every time it runs.

Tests and Documentation

Updated CHANGELOG.md and README.md with details about the new flag

@neo1203
Copy link
Author

neo1203 commented Dec 5, 2021

@eirslett , any feedback on this PR ?

@eirslett
Copy link
Owner

eirslett commented Dec 6, 2021

Can we somehow auto-detect isYarnBerry instead of specifying it in the pom?

@neo1203
Copy link
Author

neo1203 commented Dec 8, 2021

That's a nice suggestion.
We can detect the .yarnrc.yml file in the project folder.
In that case, I would still suggest to keep that additional isYarnBerry flag to handle corner cases.
Possible values and behavior :

  • Not present / empty tag : auto-detect .yarnrc.yml file in the project folder
  • A boolean (true or false) : force enable / disable

Would that be OK with you ? If it is, I will update the PR with that implementation

@eirslett
Copy link
Owner

eirslett commented Dec 8, 2021

I don't even think we need the force enable/disable. We could add it later on, if anybody really needs it (which I highly doubt). My concern is to keep the number of configuration parameters in the plugin as low as possible.

@neo1203
Copy link
Author

neo1203 commented Dec 9, 2021

Changes done.
I added support for multi-module Maven projects as part of the detection mechanism. In these setups the .yarnrc.yml file will typically be located at the root of the project and not in individual sub-folders, especially if one wants to leverage the Yarn Workspaces feature.

@eirslett eirslett merged commit 87e0b66 into eirslett:master Dec 10, 2021
@eirslett
Copy link
Owner

thanks!

@ia3andy
Copy link

ia3andy commented Oct 2, 2023

@neo1203 @eirslett when using

> yarn set version stable                                                                                                                 main(origin/main)
➤ YN0000: Retrieving https://repo.yarnpkg.com/3.6.3/packages/yarnpkg-cli/bin/yarn.js
➤ YN0000: Saving the new release in .yarn/releases/yarn-3.6.3.cjs
➤ YN0000: Done in 0s 441ms

It downloads the js locally.

Instead of pre-installing a version of yarn, why not just directly downloading the 2.x+ version from this repo:
https://repo.yarnpkg.com/[2.x+]/packages/yarnpkg-cli/bin/yarn.js
?

This would make installation consistant with the other versions configs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Yarn 2
4 participants